package ex2;

public class Hourly extends Employee {
	private int hoursWorked;
	
	public Hourly() {
		super();
		this.hoursWorked = 0;
	}
	
	public Hourly(String name, String address, String phone, String socialSecurityNumber, double payRate, int hoursWorked) {
		super(name, address, phone, socialSecurityNumber, payRate);
		this.hoursWorked = hoursWorked;
	}
	public void addHours(int moreHours) {
		this.hoursWorked += moreHours;
	}
	
	public double pay() {
		return (50*this.payRate + 10*this.hoursWorked);
	}
	
	public String toString() {
		return "Name: "+ this.name+ "--Address: "+ this.address+ "--Phone: "+ this.phone+ "--Security Number: "+ this.socialSecurityNumber + "--Pay Rate: "+ this.payRate +"--HourWorked: "+this.hoursWorked +"\n";
	}
	public int getHoursWorked() {
		return this.hoursWorked;
	}

	public void setHoursWorked(int hoursWorked) {
		this.hoursWorked = hoursWorked;
	}
}
